# CHECKLIST #
# optimization flags are on
# avg is in all directories
# thru is a sufficient value
#

echo "Did you remember to update svn?"
echo "Did you make sure the program avg is in this directory?"
echo "Did you check the iteration value 'thru'?"
echo "DID YOU MAKE SURE AVG IS COMPILED ON THIS MACHINE?"
echo "DID YOU MAKE SURE ALL TEST PROGRAMS ARE COMPILED ON THIS MACHINE?"

#!/bin/sh
thru=15;
thru2=15;

`rm -rf shift_results`
`mkdir shift_results`

######## SHIFT RESULTS SECTION ########
enum=20;
dir=shift_results;
`echo "mult shift w: $enum through 32" > $dir/avg_mult`
`echo "" >> $dir/avg_mult`
`echo "div shift w: $enum through 32" > $dir/avg_div`
`echo "" >> $dir/avg_div`

echo "Beginning test on shift"

while [ $enum -le 32 ]; do

enum2=1;
while [ $enum2 -le $thru ]; do
  `./gf_basic_tester $enum shift 50 >> $dir/tmp_results_shift_w$enum`
  enum2=`echo $enum2 | awk '{printf $1+1}'`
done

`cat $dir/tmp_results_shift_w$enum | grep "Mega Multiplies" | awk '{printf $4 "\n"}' > $dir/results_shift_multiply_w$enum`
  `cat $dir/tmp_results_shift_w$enum | grep "Mega Divides" | awk '{printf $4 "\n"}' > $dir/results_shift_divide_w$enum`

`cat $dir/results_shift_multiply_w$enum | ./avg >> $dir/avg_mult`
`cat $dir/results_shift_divide_w$enum | ./avg >> $dir/avg_div`

`rm $dir/tmp_results_shift_w$enum`

enum=`echo $enum | awk '{printf $1+1}'`
done
`rm $dir/results_*`
echo "Finished test on shift"

